<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<title>文件上传查询</title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
	var dataGrid;
	var dataGrid2;
	$(function() {
		//审核流程启动表
		dataGrid = $('#dataGrid').datagrid({
			url : '${pageContext.request.contextPath}/ywXqqtshlcController/dataGrid',
			fit : true,
			border : false,
			pagination : false,
			idField : 'ID',
			sortName : 'CREATEDATE',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			striped : true,
			rownumbers : false,
			singleSelect : true,
			columns : [ [{
				field : 'ID',
				title : '编号',
				width : 150,
				hidden : true
			}, {
				field : 'QYBMSTR',
				title : '地区编码',
				width : 200,
				sortable : true
			} ,{
				field : 'XQMCSTR',
				title : '小区名称',
				width : 150
			}
			 ,{
				field : 'CJRSTR',
				title : '录入人',
				width : 150
			},{
				field : 'LCIDSTR',
				title : '审核流程ID',
				width : 150
			}] ],
			toolbar : '#toolbar',
			onLoadSuccess : function() {
				$('#searchForm table').show();
				parent.$.messager.progress('close');
				$(this).datagrid('tooltip');
			},
			onRowContextMenu : function(e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid('unselectAll');
				$(this).datagrid('selectRow', rowIndex);
				$('#menu').menu('show', {
					left : e.pageX,
					top : e.pageY
				});
			},
			onDblClickRow :function(rowIndex,rowData){
				dataGrid2.datagrid('load', {'DDHTBHSTR_EQ':rowData.LCIDSTR });
			},
			onClickRow :function(rowIndex,rowData){
				dataGrid2.datagrid('load', {'DDHTBHSTR_EQ':rowData.LCIDSTR });
			}
			
		});
		dataGrid2 = $('#dataGrid2').datagrid({
			url : '${pageContext.request.contextPath}/seachController/scwjdataGrid',
			fit : true,
			border : false,
			pagination : false,
			idField : 'ID',
			sortName : 'CREATEDATE',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			striped : true,
			rownumbers : false,
			singleSelect : true,
			groupField:'WJLX',
			view:groupview,
            groupFormatter:function(value,rows){
                 return value + ' - ' + rows.length + ' 个文件';
             },
			columns : [ [{
				field : 'ID',
				title : '编号',
				width : 150,
				hidden : true
			} ,{
				field : 'DDHTBHSTR',
				title : '移动合同_订单合同编号',
				width : 150
			} ,{
				field : 'WJMCSTR',
				title : '文件名称',
				width : 150,
				formatter:function(val,row){
					return '<a download="" href="'+row.WJLJSTR+'">'+val+'</a>';
				}
			},{
				field : 'WJLX',
				title : '文件类别',
				width : 150
			},{
				field : 'BZSTR',
				title : '备注',
				width : 150
			},{
				field : 'CJRSTR',
				title : '创建人',
				width : 150
			},{
				field : 'CREATEDATE',
				title : '创建时间',
				width : 150
			}] ],
			onLoadSuccess : function() {
				$('#searchForm table').show();
				parent.$.messager.progress('close');
				$(this).datagrid('tooltip');
			},
			onRowContextMenu : function(e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid('unselectAll');
				$(this).datagrid('selectRow', rowIndex);
				$('#menu2').menu('show', {
					left : e.pageX,
					top : e.pageY
				});
			}
		});
	$('#cc').combobox({
		url:'${pageContext.request.contextPath}/seachController/dqbmSeach',
		valueField:'QYBMSTR',
		textField:'QYMCSTR'
	});
	});

	function searchFun() {
		dataGrid.datagrid('load', $.serializeObject($('#searchForm')));
	}
	function cleanFun() {
		$('#searchForm input').val('');
		dataGrid.datagrid('load', {});
	}
</script>
</head>
<body>
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'west',border:false,split:true" style="width:360px;">
			<table id="dataGrid"></table>
		</div>
		<div data-options="region:'center',border:false">
			<div class="easyui-layout" data-options="fit : true,border : false">
				<div data-options="region:'center',border:false">
					<table id="dataGrid2"></table>
				</div>
			</div>
		</div>
		<div data-options="region:'north',title:'查询条件',border:false" style="height: 60px; overflow: hidden;">
			<form id="searchForm">
				<table class="table table-hover table-condensed" style="display: none;">
					<tr>
						<th><div align="right">小区名称</div></th>
						<td><input name="XQMCSTR_CONTAINS" placeholder="可以模糊查询" class="span2" /></td>
						<th>地区编码</th>
						<td>
							<select id="cc" class="easyui-combobox" name="QYBMSTR_CONTAINS" style="width:217px;">
								
							</select>
						</td>
						<th><div align="right">创建时间</div></th>
						<td colspan="3"><input class="span2" name="CREATEDATE_START" placeholder="点击选择时间" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" />至<input class="span2" name="CREATEDATE_END" placeholder="点击选择时间" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<div id="toolbar" style="display: none;">
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_add',plain:true" onclick="searchFun();">过滤条件</a><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_delete',plain:true" onclick="cleanFun();">清空条件</a>
	</div>
</body>
</html>